home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
commodore-users-of-norman
/
CUON_07_(08-1984).d64
/
amort table
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
10KB
|
333 lines
1 GOTO910
2 REM ** ML STOP KEY DISABLE **
3 PRINT"x[169]=[141][169][141]X` [234][255][169][255][133][145]L4[234]x[169]1[141][169][234][141]X`
4 [153]"xhhh+hNOThhhhhhhPRINT#HRUNHX`111"
5 [153]"hhhhhhh`1"
6 [143] ** 4 - POP ML SUBROUTINE **
10 [143] **GENERAL INPUT ROUTINE **
15 :
30 :
35 [143] +++ INPUT SECTION +++
40 [151]UO,0:UR$[178]"":UI$[178]""
42 [139]UL[178]0[167]UL[178]80
45 [151]UC,0
50 [161]UI$:[139]UI$[178]""[167]50
55 [139]UI$[178][199](13)[175][195](UR$)[177][178]1[167][151]UC,1:[153]" CMD";:[137]85
60 [139]UI$[178][199](20)[167]105
62 [139] [195](UR$)[178][177]UL[167]50
65 [141]120:[143] CHECK FOR VALID CHARACTER
70 UR$[178]UR$[170]UI$
75 [153]UI$;
80 [137]50
85 [143] +++ CHECK FOR HELP REQUEST +++
90 [139]UR$[178]UX$[167]195:[143] EXIT TO HELP ROUTINE
95 [139]UF[178]1[167][141]240
100 UF[178]0:[153]:[142]
102 [143] ++ CHECK DELETE ++
105 [139][195](UR$)[179]1[167]50
110 UR$[178][200](UR$,[195](UR$)[171]1)
115 [153]"CMD CMDCMD";:[137]50
120 [143] ++ CHECK FOR VALID CHARACTERS ++
125 [139][195](US$)[178]0[167]150
130 [129]US[178]1[164][195](US$)
135 [139]UI$[178][202](US$,US,1)[167][142]
140 [130]
145 UI$[178]"":[142]
150 [143] ** STANDARD INPUT **
152 [139][198](UI$)[178]46[167][142]
155 [139]UI$[178][199](32)[167][142]
160 [139][198](UI$)[179]48[176][198](UI$)[177]57[167]170
165 [142]
170 [139][198](UI$)[179]65[176][198](UI$)[177]90[167]180
175 [142]
180 [139][198](UI$)[179]193[176][198](UI$)[177]218[167]UI$[178]"":[142]
185 [139][194](UT)[178]UU%[167]UI$[178][199]([198](UI$)[171]128):[142]
187 [142]
190 UI$[178]"":[142]
195 UF[178]1:[143] +++ HELP ROUTINE EXIT +++
197 [141]250
200 [141]245
205 [129]UQ[178]UB[164](U2%[172]256[170]U1%[170]U3%[171]2)
210 UQ%(UQ[171]UB)[178][194](UQ):[130]:[153]"LOAD"
215 UZ[178]1:UV%[178][194](UT)
216 [137]300
217 UZ[178]0:US$[178]UJ$:UG$[178]UK$:UP[178]UJ:UL[178]UK:[139][194](50003)[178]0[167][151]53281,6:[151]53280,14
220 UT$[178]UL$:[153]"LOAD";:[151]UT,UV%:[129]UQ[178]UB[164](U2%[172]256[170]U1%[170]U3%[171]3)
225 [151]UQ,UQ%(UQ[171]UB):[130]
230 [151]U1,U1%
232 [151]U2,U2%
233 [151]U4,U4%
234 [151]U3,U3%[171]1
235 [137]35
240 UD%[178]((U2%[172]256[170]U1%[170]U3%)[171]UB)[173]40:[153][200](UD$,UD%[170]1):[142]
245 [153][200](UD$,24);" HELP COMING WAIT ":[142]
250 U1%[178][194](U1):U2%[178][194](U2):U3%[178][194](U3):U4%[178][194](U4)
251 UJ$[178]US$:UK$[178]UG$:UL$[178]UT$:UJ[178]UP:UK[178]UL
255 [142]
300 [143] ** MENU **
301 :
302 [153]"LOAD":[151]UT,UU%:[139][194](50003)[178]0[167][151]53281,9:[151]53280,8
303 :
305 [153]" MENU"
310 [153]" --------------------------------------"
315 [153]" 1. BEGIN AMORTIZATION"
320 [153]" 2. STUDENT INSTRUCTIONS"
325 [153]" 3. TEACHER INSTRUCTIONS"
335 [153]" 4. QUIT"
340 [153]" --------------------------------------"
345 [153]" PRESS A NUMBER KEY (1-4) ";
350 UL[178]1:US$[178]"1234":[141]35:[143] INPUT ROUTINE
352 US$[178]""
355 [145][197](UR$)[141]1000,400,500,396
360 [137]300
395 [143] ** RE-ENABLE STOP KEY AND END **
396 [139][194](50003)[179][177]1[175][194](50003)[179][177]160[175][194](50003)[179][177]0[167]399
397 [158]UU[170]71:[139][194](50003)[178]0[167][151]53281,6:[151]53280,14
398 [153]"CONTLOAD":[128]
399 [141]875:[142]
400 [143] ** STUDENT INSTRUCTIONS **
405 [153]"LOAD":[151]UT,UL%:[139][194](50003)[178]0[167][151]53281,0:[151]53280,0
410 UT$[178]" ATNMORTIZATION":UP[178]0:UG$[178]"(null)TUDENT RIGHT$NST":[141]850
415 [153]" (null)HIS PROGRAM WILL AMORTIZE A LOAN"
420 [153]"BASED ON INFORMATION ENTERED BY THE "
425 [153]" USER."
430 [153]" (null)O RUN THIS PROGRAM, SIMPLY ENTER"
440 [153]" ALL REQUESTED DATA AND PRESS THE (null)VAL(null)(null)(null)(null)WAIT";
450 [153]" KEY WHEN DONE. "
455 [153]" (null)HERE ARE 5 DATA ITEMS IN TOTAL TO"
456 [153]" BE ENTERED."
485 [141]835
490 [139]UZ[178]1[167][158]UP%:[137]217
499 [142]
500 [143] ** TEACHER INSTRUCTIONS **
501 [153]"LOAD":[151]UT,UL%:[139][194](50003)[178]0[167][151]53281,2:[151]53280,10
502 UT$[178]" ATNMORTIZATION":UP[178]0:UG$[178]"(null)EACHER RIGHT$NST":[141]850
503 [153]" (null)O THE BEST OF OUR KNOWLEDGE,"
504 [153]" THIS PROGRAM IS IN THE PUBLIC"
505 [153]" DOMAIN. RIGHT$F THIS IS NOT THE CASE"
506 [153]" PLEASE CONTACT:"
507 [153]" LENOMMODORE PEEKUSINESS (null)ACHINES"
508 [153]" 3370 (null)HARMACY ATNVE.
509 PRINT" [193]GINCOURT, [207]NTARIO"
510 PRINT" [195]ANADA [205]1[215] 2[203]4"
511 PRINT" (416) 499-4292"
512 UP=1:GOSUB 835:GOSUB 850:
513 PRINT" [208]ROGRAM [206]AME: [193]MORTIZATION
514 [153]" (null)RITTEN PEEKY : (null)NKNOWN
515 PRINT" [213]PGRADED [194]Y :
516 [153]" (null)HIS PROGRAM WILL RUN ON ANY
517 PRINT" [194][193][211][201][195][160]2.0 [208][197][212] [195][207][205][208][213][212][197][210]
518 [153]" PEEKATN(null)RIGHT$LEN 4.0 (null)VAL(null)CLOSELEN(null)(null)(null)(null)(null)VAL(null)
519 PRINT" 8032 [195][194][205] [195][207][205][208][213][212][197][210]
520 [153]" LEN(null)(null)(null)(null)STR$(null)(null)VAL 64 LEN(null)(null)(null)(null)(null)VAL(null)
521 GOSUB835
590 IFUZ=1THENSYSUP%:GOTO217
599 RETURN
600 REM ** PROGRAM MODIFICATION INST **
601 PRINT"[147]":POKEUT,UL%
605 UP=0:UG$="[208]ROGRAM [205]OD":GOSUB850
660 GOSUB835
690 IFUZ=1THENSYSUP%:GOTO217
699 RETURN
700 REM ** TO USE 8032 LOAD CBM4032 **
710 PRINT"[147]BEFORE RUNNING THIS PROGRAM ON AN 8032
720 [153]" LOAD THE 'CBM 4032' PROGRAM"
730 [158]UU[170]71
740 [128]
800 [143] ** T I T L E P A G E **
802 [153]"LOAD";:[151]UT,UU%:[139][194](50003)[178]0[167][151]53280,14:[151]53281,6
804 [129]I[178]1[164]38:[153]"SPC(WAIT";:[130]
806 [129]I[178]1[164]22:[153]"CMDSPC(WAIT";:[130]
808 [129]I[178]1[164]37:[153]"CMDCMDSPC(WAIT";:[130]
810 [129]I[178]1[164]22:[153]"ONCMDSPC(WAIT";:[130]
812 [153]"STEP WAIT
814 PRINT" [146] [146][169]
816 [153]" WAIT TAB((null)
818 PRINT"[223] [146]
820 [153]"C O M M O D O R E
822 PRINT"EDUCATIONAL
824 [153]"SOFTWARE
826 REM ** COMMODORE LOGO **
827 PRINTLEFT$(UD$,24);"PRESS SPACE BAR OR WAIT[146]":I=0
828 GETA$:IFA$<>" "THENI=I+1:IFI<250THEN828
830 T1$="":T2$="":T3$="":T4$="":I=0
832 GOTO300
835 REM ** SPACE BAR PRESS **
840 POKEUO,0:PRINTLEFT$(UD$,24);"PRESS SPACE BAR TO CONTINUE[146]"
844 GETUI$:IFUI$<>" "THEN844
846 RETURN
850 REM ** PAGE DESIGN ROUTINE **
852 UP=UP+1
855 PRINT"[147]"LEFT$(UT$+UP$,21);RIGHT$(UP$+UG$+STR$(UP),18)
860 PRINT" --------------------------------------"
864 IFUH<>0THEN870
865 REM PRINTLEFT$(UD$,24);LEFT$(UP$,7);"HELP - PRESS H <RETURN>"
870 UH=0:PRINT"":RETURN
875 REM ** PLEASE WAIT REMARK **
880 PRINTLEFT$(UD$,24);" ONE MOMENT PLEASE... "
885 RETURN
900 REM ** SET UP VARIABLES **
901 UX$="H":DIMUQ%(1000):UB=32768:U1=196:U2=197:U3=198:U4=216:UC=167:UU=1024
902 UT=59468:UU%=12:UL%=14:UP%=1146:UM=32768:UO=158:POKE 50003,0
903 IFPEEK(50003)=0THENUB=1024:U1=209:U2=210:U3=211:U4=214:UC=204:UU=2048
904 IFPEEK(50003)=0THENUT=53272:UU%=21:UL%=23:UP%=2139:UM=1024:UO=198
905 UD$=""
906 UP$=" "
907 UT$=" [193]MORTIZATION [160][160][160][160][160]":REM PLACE PROGRAM TITLE HERE !!!!!!!!!!!!!!!!!***
908 RETURN
910 REM ** SET VARIABLES **
915 GOSUB900
920 REM ** CHECK FOR 8032 **
925 PRINT"[147]":PRINT"[160]":REM SHIFTED SPACE
930 IFPEEK(UB+40)<>96THENGOSUB700
931 REM ** MEMORY CHECK **
932 IF FRE(0)>2000THEN937
933 PRINT"[147]THIS MACHINE DOES NOT HAVE ENOUGH"
934 PRINT"MEMORY TO RUN THIS PROGRAM !"
935 SYSUU+71
936 END
937 PRINT"[147]":IFPEEK(50003)=0THEN962
940 REM ** BASIC 2.0 OR 4.0 OR C-64 SETUP **
941 POKE1075,133:POKE1076,144:POKE1077,234:POKE1079,4:POKE1080,133:POKE1081,145
942 POKE1091,155:POKE1098,133:POKE1099,144:POKE1100,234:POKE1103,133
943 POKE1104,145:POKE1105,234:POKE1082,234
945 IFPEEK(50003)<>160THEN955
950 POKE1093,88:POKE1094,228:POKE1097,85:POKE1102,228:GOTO965
955 IFPEEK(50003)<>1THEN990
960 POKE1093,49:POKE1094,230:POKE1097,46:POKE1102,230:GOTO965
962 POKE2099,141:POKE2100,20:POKE2101,3:POKE2103,8:POKE2104,141:POKE2105,21
963 POKE2106,3:POKE2115,145:POKE2117,52:POKE2118,234:POKE2121,49:POKE2122,141
964 POKE2123,20:POKE2124,3:POKE2126,234:POKE2127,141:POKE2128,21:POKE2129,3
965 SYSUU+48:REM DISABLE STOP KEY
970 GOSUB800:REM TITLE
980 GOTO300:REM MENU
990 PRINT"[147]THE PGM WILL NOT WORK ON THIS MACHINE!":END
1000 IFUZ=1THENSYSUP%:SYSUP%:UZ=0:REM ** PROGRAM STARTS HERE **
1001 PRINT"[147]";:RESTORE:IFPEEK(50003)=0THENPOKE53281,6:POKE53280,14
1002 UG$=""
1010 UT$=" AMORTIZATION"
1060 D2$=""
1110 B1$=" "
1115 BL$=" [157][157][157][157][157][157][157][157][157][157]"
1120 UP=0:UG$="DATA ENTRY":GOSUB850
1160 PRINT" 1[146]. WHAT IS THE NOMINAL INTEREST RATE"
1210 PRINT" PER ANNUM? (%) "BL$;:GOSUB10000:I=VAL(UR$)/100
1220 IFFLTHENPRINT"[145][145][145][145][145]":GOTO1160
1230 IFI>30THENPRINT"[145][145][145][145][145]":GOTO1160
1260 PRINT" 2[146]. WHAT IS THE NUMBER OF INTEREST"
1310 PRINT" PERIODS PER ANNUM? "BL$;:GOSUB10000:N=VAL(UR$)
1320 IFFLTHENPRINT"[145][145][145][145][145]":GOTO1260
1330 IFN>366THENPRINT"[145][145][145][145][145]":GOTO1260
1360 PRINT" 3[146]. WHAT IS THE NUMBER OF PAYMENTS"
1410 PRINT" PER ANNUM? ";BL$;:GOSUB10000:P=VAL(UR$)
1420 IFFLTHENPRINT"[145][145][145][145][145]":GOTO1360
1430 IFP>100THENPRINT"[145][145][145][145][145]":GOTO1360
1460 PRINT" 4[146]. WHAT IS THE AMOUNT"
1510 PRINT" OF THE LOAN? ($) ";BL$;:GOSUB10000 :L=VAL(UR$)
1520 IFFLTHENPRINT"[145][145][145][145][145]":GOTO1460
1530 IFL>9999999 THENPRINT"[145][145][145][145][145]":GOTO1460
1535 UP=1:UG$="DATA ENTRY":GOSUB850
1560 PRINT" 5[146]. HOW MANY YEARS ARE THERE TO"
1610 PRINT" TO REPAY THE LOAN? ";BL$;:GOSUB10000:K=VAL(UR$)
1620 IFFLTHENPRINT"[145][145][145][145][145]":GOTO1560
1625 IFK>100THENPRINT"[145][145][145][145][145]":GOTO1560
1630 GOSUB399
1660 E=(1+I/N)^(N/P)-1
1710 X=((1-(1+E)^(-P*K))^-1)*E*L
1760 N1=X:GOSUB5560:X$=N1$
1810 N1=L:GOSUB5560:L$=N1$
1860 GOSUB5260
1910 PRINT"[176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]":POKEUM+39,110
1960 FORI=1TO21:PRINT"[221]":POKEUM+39+40*I,93:NEXT
2010 PRINT"[173][192][192][192][177][192][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][192][192][192]":POKEUM+919,125
2060 PRINTTAB(10)"AMORTIZATION TABLE"
2110 PRINTTAB( 8)"INSTALMENT OF ";X$
2160 PRINTTAB(2)"PAID";P;"TIMES PER YEAR FOR";K;"YEARS"
2210 PRINTTAB(12) P*K;"PAYMENTS"
2260 PRINT"[171][192][192][192][178][192][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][192][192][192]":POKEUM+279,115
2310 PRINTTAB(1)"PAY[221] INTEREST [221] PAYMENT [221]OUTSTANDING"
2360 PRINTTAB(1)"NO.[221] ON DEBT [221]ON PRINC. [221] DEBT "
2410 PRINTTAB(0)"[171][192][192][192][219][192][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][192][192][192]":POKEUM+399,115
2460 FORI=1TO12:PRINTTAB(4)"[221]"SPC(10)"[221]"SPC(10)"[221]" :NEXT
2510 PRINTTAB(2)"[145][145][145][145][145][145][145][145][145][145][145][145] "SPC(25) L$
2560 PRINTTAB(0)"[171][192][192][192][219][192][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][192][192][192]":POKEUM+479,115
2610 OS=L:CC=0
2660 FORJ=(CC+1)TO(CC+10)
2710 IN=OS*E
2760 N1=IN:GOSUB5560:IN$=N1$
2810 PY=X-IN
2860 N1=PY:GOSUB5560:PY$=N1$
2910 NS=OS-PY
2960 N1=NS:GOSUB5560:NS$=N1$
3010 N1=J:GOSUB6310: PRINTTAB(1)N1$;
3060 PRINTTAB( 5)IN$;
3110 PRINTTAB(16)PY$;
3160 PRINTTAB(29)NS$
3210 IFNS>=XTHEN3760
3260 J=J+1 :IN=NS*E
3310 N1=IN:GOSUB5560:IN$=N1$
3360 PY=NS-IN
3410 N1=J:GOSUB6310: PRINTTAB(1)N1$;
3460 N1=IN:GOSUB5560:PRINTTAB( 5)N1$;
3510 N1=NS:GOSUB5560:PRINTTAB(16)N1$;
3560 PRINTTAB(33)"NIL"
3610 N1=IN+NS:GOSUB5560
3660 IFX$<>N1$THENPRINT"":PRINTTAB(17)"LAST PAY'T:";N1$
3710 GOTO4360
3760 OS=NS
3810 NEXTJ
3860 IFP*K>JTHEN3960
3910 GOTO4360
3960 CC=CC+10
4070 GOSUB12000
4210 GOSUB5410:PRINTTAB(0)"";B1$
4260 PRINT""
4310 GOTO2660
4360 :
4410 GOSUB835:RETURN
4710 F1$="[166][160][166][160][166][160][166][160][166][160][166][160][166][160][166][160][166][160][166][160][166][160][166][160][166]"
4760 F2$=" "
4810 F3$="[166] [166]"
4860 D1$=""
4910 PRINT"[147]";D1$;:PRINTTAB(8)F1$
4960 FORS=1TO5:PRINTTAB(8)F2$:PRINTTAB(8)F3$:NEXT
5010 PRINTTAB(8)F2$:PRINTTAB(8)F1$:PRINTD1$+"";
5060 PRINTTAB(14)"AMORTIZATION"
5110 PRINTTAB(17)"TABLES"
5160 GOSUB835: RETURN
5210 FORS=1TO2000:NEXT:RETURN
5260 GOTO5360
5310 FORS=0TO24:PRINTB1$:POKE32807+40*S,32:NEXT
5360 PRINT"[147]":RETURN
5410 C1$=" "
5460 PRINT"";:FORS=1TO10:PRINTTAB(1)C1$:NEXT
5510 RETURN
5560 N2=INT(100*N1+.5)/100
5610 IFN2>0ANDN2<1THENN1$=" $"+STR$(VAL(MID$(STR$(N2),2))):GOTO6010
5660 IFN2<10THENN1$=" $"+MID$(STR$(N2),2):GOTO6010
5710 IFN2<100THENN1$=" $"+ MID$(STR$(N2),2):GOTO6010
5760 IFN2<1000THENN1$=" $"+ MID$(STR$(N2),2):GOTO6010
5810 IFN2<10000THENN1$=" $"+ MID$(STR$(N2),2):GOTO6010
5860 IFN2<100000THENN1$=" $"+ MID$(STR$(N2),2):GOTO6010
5910 IFN2<1000000THENN1$="$"+ MID$(STR$(N2),2):GOTO6010
5960 N1$=MID$(STR$(N2),2)
6010 IFN2=INT(N2)THENN1$=N1$+".00" :GOTO6260
6060 IFN2>10THENR=N2-INT(N2/10)*10 :GOTO6160
6110 R=N2
6160 N%=10*R :NN%=100*(R+.005)
6210 IF10*N%=NN%THENN1$=N1$+"0"
6260 RETURN
6310 IFN1<10THENN1$=" "+MID$(STR$(N1),2):GOTO6460
6360 IFN1<100THENN1$=" "+MID$(STR$(N1),2):GOTO6460
6410 N1$=MID$(STR$(N1),2)
6460 RETURN
6510 N1= 81274.6954 :N1$=MID$(STR$(N2),2)
6560 GOSUB5560
6610 PRINT"[147]N1:";N1:PRINT"N2:";N2:PRINT"R:";R:PRINT"N%:";N%:PRINT"NN%:";NN%:PRINT"N1$:";N1$
10000 FL=0:US$="0123456789.":UL=10:GOSUB35:IFVAL(UR$)<1THENFL=1
10010 RETURN
12000 PRINTLEFT$(UD$,24)" PRESS SPACE[146] TO CONTINUE, E[146] TO EXIT ":POKEUO,0
12015 GETA$:IFA$=" "THENRETURN
12016 IFA$="E"THENSYSUP%:RETURN
12017 GOTO12015